Page({
  onShareAppMessage(options) {
    return {
      title: this.data.documentTitle,
	    imageUrl:this.data.imgsrc,  
      path: '/pages/index/index?shareUrl=' + options.webViewUrl,
    }
  },

  onLoad: function(options) {
    if (options.shareUrl) {
      this.setData({
        src: options.shareUrl
      })
    }
  },

  data: {
    documentTitle: '',
	  imgsrc:'',
    src: 'https://byafilm.sunthink.com.cn/app.php'
  },

  //接收web-view传递的参数
  getMsg(e) {
    if (e.detail.data[0]){
      var len = e.detail.data.length
      this.setData({//存储状态
        documentTitle: e.detail.data[len-1].title,
		    imgsrc:e.detail.data[len-1].imgsrc,
      })
    }
  }
})
